UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Qsxo3xPKo+t6JjDrBfe3nKc6dH/fppw3jQQUgIKRj2Q='
WHERE
key_id = '4b22c55bdf95b9cc1ee1681c60e37cb9fe6ef1bd16fd3d36b3e4a476cbf9e5e8'
AND (
token = 'Qsxo3xPKo+t6JjDrBfe3nKc6dH/fppw3jQQUgIKRj2Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)