UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ahfMqvGogWtyxB1b1wqgYJpC+jw7d0C6HgNjHLBg50o=' 
WHERE 
  key_id = 'a3b6f4a75985ec1b3225010d6cc594aa0440d74f993c6a51552da2b967859f82' 
  AND (
    token = 'ahfMqvGogWtyxB1b1wqgYJpC+jw7d0C6HgNjHLBg50o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019