UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'y1JOEcJc82EUrcRAp+Gm2U0hNZLpQ4Ozj3PqZDUt2IE='
WHERE
key_id = '4374b8b91dd25be8eb24d73d84d65d88c885f4d93846cfa70e846e7b4f9c08e2'
AND (
token = 'y1JOEcJc82EUrcRAp+Gm2U0hNZLpQ4Ozj3PqZDUt2IE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)