UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qVjql7qlJM2Kme3b2JBVlpZ7zN2FoVmIbvQVT7CJmqA='
WHERE
key_id = 'aaf637723742ea0fc089e33c19fd024c0a8ce8dff7812b65b65a675c63478f4d'
AND (
token = 'qVjql7qlJM2Kme3b2JBVlpZ7zN2FoVmIbvQVT7CJmqA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)