UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZOdjhbGhY1wK5RuX1c13JlquzHd/74D1Tzg1s+s9pCg='
WHERE
key_id = '823bc35f9db0a1b18a150bdb6be3d15ff011857a11a6f59e42b3a03d8434407a'
AND (
token = 'ZOdjhbGhY1wK5RuX1c13JlquzHd/74D1Tzg1s+s9pCg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)