UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RPi7gh9EoBKh4Ontlz0Ng6zhM5y9B63dzdCIdZaJydY='
WHERE
key_id = '61e0f2dbbada46dc98a8a62154827d3f4fb8807b47c9063b0fea4f34b444e88d'
AND (
token = 'RPi7gh9EoBKh4Ontlz0Ng6zhM5y9B63dzdCIdZaJydY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)