UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5ZrvkFh9zvTKjoDR9lhn64YzCYonvoSJ3mmTzZWFdDE=' 
WHERE 
  key_id = '591dfb773df7646b67f8b5206592ded42edaf6c4de89fdc7e1f8f271c3acf734' 
  AND (
    token = '5ZrvkFh9zvTKjoDR9lhn64YzCYonvoSJ3mmTzZWFdDE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049