UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9aZjpn7ZiuGC9ccsH7YW+UYpSnduQY8LYHa/5ht47cc='
WHERE
key_id = '95ce4b2a8eceb258d6555dfbe6d1d07ae5f2ba78230c72365b526a6a8b748217'
AND (
token = '9aZjpn7ZiuGC9ccsH7YW+UYpSnduQY8LYHa/5ht47cc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)