UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8WoDCVIKq3JHpCIATBfaND89hnkxy5Gjy3nLIbQYTzM='
WHERE
key_id = '71b18b3d2cb4640952668f10256d3e3b3c2f658d15e1ac08e680639bd9427094'
AND (
token = '8WoDCVIKq3JHpCIATBfaND89hnkxy5Gjy3nLIbQYTzM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)