UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rSoQgL7Mf7NospUsVCPu/bo0x1Whkr4IlF3xay4VFVE='
WHERE
key_id = 'ce60259962cc404e92676a843b137dee865033c7e5a3d7db3a933f237763d572'
AND (
token = 'rSoQgL7Mf7NospUsVCPu/bo0x1Whkr4IlF3xay4VFVE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)