UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dzxaZPVOPzbOGgPoosW/g097UaH26WTRqOfN9LjaWhw='
WHERE
key_id = '013301246c88fe85da45bfffdb372e2e738d9bacb974a4434a93a00ddde43edc'
AND (
token = 'dzxaZPVOPzbOGgPoosW/g097UaH26WTRqOfN9LjaWhw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)