UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'b8bq/XonaQSJHnHsyGl8Djr/4NI7qOp+O1nin0AMHys='
WHERE
key_id = '66c22921398c7b787f669a1979ebc9658c911a12e6929efe7bcbcc5d2756a713'
AND (
token = 'b8bq/XonaQSJHnHsyGl8Djr/4NI7qOp+O1nin0AMHys='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)