UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UQauTCsvdx8UdOb9LhsLQLuw1Pq8dFGUhucc9aMUE0Y='
WHERE
key_id = '4e34ec6ad411fd3bede35399e9c2d92cbcca0f1bb96849a7c6e9b9500d70a961'
AND (
token = 'UQauTCsvdx8UdOb9LhsLQLuw1Pq8dFGUhucc9aMUE0Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)