UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'saO0V5mkYi+Op0I+84S5CGRPsSqR+19mp74qpT9RVj4='
WHERE
key_id = 'de08d7e1220d8025c578c6f49a77d06aeb4a98fe838bdde8dae3dab8827d9140'
AND (
token = 'saO0V5mkYi+Op0I+84S5CGRPsSqR+19mp74qpT9RVj4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)