UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BvDHcXlX7jvDBu71i+pXLm+JuN4J8HkyCM/ULa4tnoQ=' 
WHERE 
  key_id = 'cc6e1ead9447bcb657a28b380a4fe3b9a84dedff2b696bf71491f4ae92aa56cd' 
  AND (
    token = 'BvDHcXlX7jvDBu71i+pXLm+JuN4J8HkyCM/ULa4tnoQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023