UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6sCCqzcL+IURX2cbpK2DWq1tUuCgYXltSlmpXGa4cWY='
WHERE
key_id = '91266a50bad8209ebe86081de4bc946479530731b853edc55ca3ab069b3f2af3'
AND (
token = '6sCCqzcL+IURX2cbpK2DWq1tUuCgYXltSlmpXGa4cWY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)