UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jocsBWClR52ZjOhEIsfO5/rJi1NrJGVfLNZPaw+mdGo='
WHERE
key_id = '6e8f136b2110463aba051360c9d8dee46b04f67f1b8e8c543cc34088cbd5559d'
AND (
token = 'jocsBWClR52ZjOhEIsfO5/rJi1NrJGVfLNZPaw+mdGo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)