UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gLFEg4mF5f/gOL/ox4bVVA8iqPvYlxc+oetEs5utp7Y=' 
WHERE 
  key_id = '22542a2d53557d5979923c8b51f323edad6ea83ba4d244a74616867b5c3f3e93' 
  AND (
    token = 'gLFEg4mF5f/gOL/ox4bVVA8iqPvYlxc+oetEs5utp7Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025