UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gOvyI1prOCprCJkG4fLSpJAh5Elkl+urfTMpJhrEJ8w=' 
WHERE 
  key_id = 'a14307c2c9f3a40f3ce3579974adf068de8407f87c0dcb18b0bc688b2011eb0c' 
  AND (
    token = 'gOvyI1prOCprCJkG4fLSpJAh5Elkl+urfTMpJhrEJ8w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026