UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Dvaix8XxVu5mGStsdYUt6fou+1yv5KoaJmz5gkAAJyY='
WHERE
key_id = '9b66ebe649782a905ead62f84e136340f293e65ebe19b178f70e7658316f407c'
AND (
token = 'Dvaix8XxVu5mGStsdYUt6fou+1yv5KoaJmz5gkAAJyY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)