UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qd56iv3cHLoXRQii/tZXFiGlIpyv5JOr1bJxqUFGYgs='
WHERE
key_id = 'e28ef88c56c56b201ba9222eff5e3c5d90e52d13172862cf400d86bac558c49f'
AND (
token = 'qd56iv3cHLoXRQii/tZXFiGlIpyv5JOr1bJxqUFGYgs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)