UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '48is6J5GnRIpyFXiKVaGHArITe9cCSMT/yodoqw89cU='
WHERE
key_id = '7ed5a1ba8def10ea9b5a09d9ad071ed0cc6d9c58e5a8af4eb4c9a34ecd91727b'
AND (
token = '48is6J5GnRIpyFXiKVaGHArITe9cCSMT/yodoqw89cU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)