UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'e5N239R/opm82svzDuAIXhmiLsv6XsKQVQaVJ8Rld6g='
WHERE
key_id = '673548ec87f62a4e48ec3fd65e37e5b0d3f4f04db8ff7df3745e8dea6cfe4c44'
AND (
token = 'e5N239R/opm82svzDuAIXhmiLsv6XsKQVQaVJ8Rld6g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)