UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BnY1yMy9x9990V2/TyWMFNeN9LGeIGlHTS40psQaJzQ='
WHERE
key_id = '62cb809aebeaf7452b4607487c986a48f773cec8b72ae3d5fa769447ed888eba'
AND (
token = 'BnY1yMy9x9990V2/TyWMFNeN9LGeIGlHTS40psQaJzQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)