UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IhEagpOW6qix11lnCi6Ms2Iws0GHCK3mxOEhdjZyWo0=' 
WHERE 
  key_id = '2c27b7f6b90e63dcb22fe62d2ce44f5adf388d442540a2fae7da672ca1f09f08' 
  AND (
    token = 'IhEagpOW6qix11lnCi6Ms2Iws0GHCK3mxOEhdjZyWo0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030