UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Q8mS1ZsgcYt5seMe7AdXlpANM2Xio8VFo/KUWcH3Vvc='
WHERE
key_id = '80649c91c4b31130ce85799412c08a86cfaa031ae12fd132b86a67c7ab1750e8'
AND (
token = 'Q8mS1ZsgcYt5seMe7AdXlpANM2Xio8VFo/KUWcH3Vvc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)