UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'V3TENFwK99s0JapfnMI9j5lTVpK0JP52iVEo9KiqTJo='
WHERE
key_id = '4701fd1ea8bb3e24a6acf8985b9f60edb4d2221f567097832af8afbeaa5723af'
AND (
token = 'V3TENFwK99s0JapfnMI9j5lTVpK0JP52iVEo9KiqTJo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)