UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'X9mHb8zFchDyWWlh+f00tvZvd/xwG/LPx+U6tKR2rFE='
WHERE
key_id = '496b558b686c9e038c64bfb2b2eae754091dc6ccdf4bceff2b4eb201088deaaf'
AND (
token = 'X9mHb8zFchDyWWlh+f00tvZvd/xwG/LPx+U6tKR2rFE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)