UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 't9rzRLI2EA/rqCekJQL7BS7y74weCQFf/UojCaJT0FA='
WHERE
key_id = 'aece62e9f01fd3f71d9f34c76cdeff761a0cef9d9f83917e732401c0bab05647'
AND (
token = 't9rzRLI2EA/rqCekJQL7BS7y74weCQFf/UojCaJT0FA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)