UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ECr9JAaDOXF8T9UFZy0R/prONCBQQD7Bg5Ab78BMD1g=' 
WHERE 
  key_id = '3cc6af6838e6adc5ef36914216c907bd1af9af0b8b1f9c1c6311777a36c87ec2' 
  AND (
    token = 'ECr9JAaDOXF8T9UFZy0R/prONCBQQD7Bg5Ab78BMD1g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028