UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vOegoeIMulZIj+lMt8HEu7SN3YxfuM9ZEi0xtNXUJkQ=' 
WHERE 
  key_id = 'e98f8fcbffe830c2d3b7a02bdd4d975023f7f5824ab326c812321d03c7fb1e2e' 
  AND (
    token = 'vOegoeIMulZIj+lMt8HEu7SN3YxfuM9ZEi0xtNXUJkQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023