UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'abqX4/gxqFMPA3hKSvpZ2Jj6Jpxk7Ag5gR26v0K69kk=' 
WHERE 
  key_id = 'b5ee6caefec380b2ff5f6d276f9226f9944bc52e86e864ebcc1ec188a545f6cd' 
  AND (
    token = 'abqX4/gxqFMPA3hKSvpZ2Jj6Jpxk7Ag5gR26v0K69kk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026