UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0KajXLQpW/+XbuHlKpm769Ff11TfLaX3iv/9PnV8/Lk='
WHERE
key_id = '9b16c485f98564994df5bafd55d366ba04708e5c83b536afe439ef52f36dda0a'
AND (
token = '0KajXLQpW/+XbuHlKpm769Ff11TfLaX3iv/9PnV8/Lk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)