UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'V9yxfTi0hwVMiWBWqJ/f/JzbLeV0/kZt/RwogxvUHTs='
WHERE
key_id = '6c8f44654425005a260377c258aacae39e1773bf633d65cd16c81d5a2518c09f'
AND (
token = 'V9yxfTi0hwVMiWBWqJ/f/JzbLeV0/kZt/RwogxvUHTs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)