UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Tbte/lv8cE0AcQi1QozNEFISPxulvffcZUH0ggVfnwM='
WHERE
key_id = '0ce70abeaf4407f130a24a6d805dcd1b69840ec8a3f9a6620d389d36eecb22f8'
AND (
token = 'Tbte/lv8cE0AcQi1QozNEFISPxulvffcZUH0ggVfnwM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)