UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YBYm7xwrRMCRdXlgaQFXt4Am3bACoKQTwqilfZSusWQ='
WHERE
key_id = '8b1fb59027675ddd2107f088e3c8310cbc520f70263b4a68ae3f7f35f06ed5b2'
AND (
token = 'YBYm7xwrRMCRdXlgaQFXt4Am3bACoKQTwqilfZSusWQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)