UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hwvu1NB89DbF+dUtbWFJwBpw9ud5wLhzoIk7DlwaoiA='
WHERE
key_id = 'e8df623cc0c248a91021df611ed67d80bc7e997d8ae03a2915f8c8d0b61cbc98'
AND (
token = 'hwvu1NB89DbF+dUtbWFJwBpw9ud5wLhzoIk7DlwaoiA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)