UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XbACdxHqFxINvrHQkKcvY1hxz8+U/I4/p97Y0yJ083I=' 
WHERE 
  key_id = '79424e3b9b2d5c1824fa6d43856a6c7538217ef17170bde74379f1ee1a06057c' 
  AND (
    token = 'XbACdxHqFxINvrHQkKcvY1hxz8+U/I4/p97Y0yJ083I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033