UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ho98If+NPqCF2EMKafSwxn479w00EeXtOdQFtlEvBtk='
WHERE
key_id = 'e262d2a64062da3d0d159747316d8904e2ed5b077ea8433b3dd90e876f32f70a'
AND (
token = 'ho98If+NPqCF2EMKafSwxn479w00EeXtOdQFtlEvBtk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)