UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9gwFFMCtQ8/6P33o1nOx1GDoxDXgLZwgUZFhG2Mk+dU='
WHERE
key_id = 'ddce907f3de0015c0e22ad7512609fe578a1d6fca4cfff56de28777c97fa0bb9'
AND (
token = '9gwFFMCtQ8/6P33o1nOx1GDoxDXgLZwgUZFhG2Mk+dU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)