UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'H1o6vq6l/yMb0wuasW9B6xycjHpW6tr+tdn2kOnaLKk='
WHERE
key_id = 'e9cc636ab2bf6fcffaa2355d5a61e044516aa1c38272fbe5c304718bd3865859'
AND (
token = 'H1o6vq6l/yMb0wuasW9B6xycjHpW6tr+tdn2kOnaLKk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)