UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7fzZIcb2Y26oVSJ+fxNF0FxftOvYUe7eABYC4Yo8leY='
WHERE
key_id = '95930fa41933a6adcf9d181b6d08a361f04f97fb42595673ec319b027c187d89'
AND (
token = '7fzZIcb2Y26oVSJ+fxNF0FxftOvYUe7eABYC4Yo8leY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)