UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FzLvl95LTNCO7kuDzfQ/EWUsBqlrSmXoxAdXcCmGiEs='
WHERE
key_id = '0e04dd84fdbea8474968fd7c83a088435e950a0dea28d0702685d7fc2bc7f1d8'
AND (
token = 'FzLvl95LTNCO7kuDzfQ/EWUsBqlrSmXoxAdXcCmGiEs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)