UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'F+zpiwjp6dvhjdc7KljfiF1aSmaLmH/NbamScqTl7n8=' 
WHERE 
  key_id = 'ab995a745d2a5198820a8a5d046d82dd788bca7e9ebf40003952d26216274c06' 
  AND (
    token = 'F+zpiwjp6dvhjdc7KljfiF1aSmaLmH/NbamScqTl7n8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034