UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WQ7APX7WIEkodpS1EitUTReVidooqRexHzVbIjKLr0k='
WHERE
key_id = '01df9bc08d173c3943d66e9b263d82f4520ecd7081aaf262900d6f6e5425ce96'
AND (
token = 'WQ7APX7WIEkodpS1EitUTReVidooqRexHzVbIjKLr0k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)