UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eeE2S04xGt7Di+zx39a8iC8QfhTMNZg/MlPTSMlWaDo='
WHERE
key_id = '51e9920bdd5b2bad1d3167bcefe4fb25a90f5e940128790c4d1d4307c6059aa2'
AND (
token = 'eeE2S04xGt7Di+zx39a8iC8QfhTMNZg/MlPTSMlWaDo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)