UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qlOvdHWNIs8sj9fTe2HmWDCtrOADqHq4DGCRiXGKTGA='
WHERE
key_id = '014e1123725c449571f280f6578c67558f7f81f3efbb7f84168b4538a6b6003b'
AND (
token = 'qlOvdHWNIs8sj9fTe2HmWDCtrOADqHq4DGCRiXGKTGA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)