UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rEviDowMa458brRJa7NDLpSuoxm3U9mFr23LmNEsJyo='
WHERE
key_id = '8603047f5eb46ca0edc11a6026dd74cb0b86d3cb891626a15c2e45d77356d01a'
AND (
token = 'rEviDowMa458brRJa7NDLpSuoxm3U9mFr23LmNEsJyo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)