UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'f9EQ/xR0ny5NG3dsRtAo2SXkZeprDkemIIWnQOpWeqU='
WHERE
key_id = 'aa4225c3d4a4f710cc0e534b09bd06fad8bd426a0cae06ad0240fa01fa953523'
AND (
token = 'f9EQ/xR0ny5NG3dsRtAo2SXkZeprDkemIIWnQOpWeqU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)