UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eD7JWSsSd9aCV7bIiLM92LnUXaG83mGUYI6cnSxyBd0='
WHERE
key_id = 'cff508dca546366a7934bb8f2d0990cdfff7bd1d238ee3229a8e2aae117c1d78'
AND (
token = 'eD7JWSsSd9aCV7bIiLM92LnUXaG83mGUYI6cnSxyBd0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)