UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dw/BMnmlFVcBFWOSPoh9Ipr8zzxe8AoeW9OI98vy3eI='
WHERE
key_id = '1bf3e344ddf03fb26ae73839d99465f69dc9807a74a525c350f5ee86148dc71d'
AND (
token = 'dw/BMnmlFVcBFWOSPoh9Ipr8zzxe8AoeW9OI98vy3eI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)